package com.starbaba.spread.model;

import java.io.Serializable;
import java.util.List;

import com.base.common.database.BaseDao;
import com.base.common.exception.AppException;
import com.starbaba.comment.model.EntityVO;
import com.starbaba.model.dictionary.Constant;

public class SpreadChannelModel  implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3408432007501579573L;
	
	private String id;
	
	private Long type;
	
	private String channel;
	
	private String memo;
	
	private String startTime;
	
	private String endTime;
	
	private List<TableVO> data;
	
	private String activity;

	private String shortLink;
	
	private static List<EntityVO> statusList;
	
	private static List<ChannelOB> channelList;

	public List<TableVO> getData() {
		return data;
	}

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}
	
	public static List<EntityVO> getStatusList() {
		return statusList;
	}

	public void setData(List<TableVO> data) {
		this.data = data;
	}

	public static void setStatusList(List<EntityVO> statusList) {
		SpreadChannelModel.statusList = statusList;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Long getType() {
		return type;
	}

	public void setType(Long type) {
		this.type = type;
	}
	
	public void initChannelSource() {
		if (null != channelList) {
			return ;
		}

		channelList = null;
		BaseDao dao = new BaseDao(Constant.POOL_LIFE);
		String sql = "select id,name from loan.spread_channel";
		try {
			
			channelList = dao.list(sql, ChannelOB.class);
			for(ChannelOB name: channelList){
				System.out.println(name.getChannel_name() + " : " + name.getChannel_code());
			}
		} catch (AppException e) {
			e.printStackTrace();
		}
	}
	
	public SpreadChannelModel(){
		initChannelSource();
	}
	
	public static List<ChannelOB>  getChannelList() {
		return channelList;
	}

	public static void setChannelList(List<ChannelOB> channelList) {
		SpreadChannelModel.channelList = channelList;
	}

	public String getChannel() {
		return channel;
	}

	public void setChannel(String channel) {
		this.channel = channel;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public String getActivity() {
		return activity;
	}

	public void setActivity(String activity) {
		this.activity = activity;
	}

	public String getShortLink() {
		return shortLink;
	}

	public void setShortLink(String shortLink) {
		this.shortLink = shortLink;
	}
}
